package com.up.upzl.biz.util;

import java.nio.charset.Charset;

import com.google.common.hash.Hashing;

/**
 * 加密工具类
 * 
 * @author geeks
 *
 */
public class PasswordHelper {

	/**
	 * 复刻原优铺的加密
	 * 
	 * @param password
	 *            密码明文
	 * @return 加密后的密码
	 */
	public static String md5HashX(String password) {
		String key1 = "696C6F7665737175616C6C";
		String key2 = "383631303038";
		@SuppressWarnings("deprecation")
		String passwordEncrypt = Hashing.md5().hashString(key1 + password + key2, Charset.forName("UTF-8")).toString();
		return passwordEncrypt.substring(2, 2 + 14).toUpperCase();

	}
}
